﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Silmoon.DNS.Monitoring
{
    public class Startup
    {
        public GBC g;

        public Startup()
        {
            g = new GBC();
            g.OnOutputTextMessage += new MySilmoon.OutputTextMessageHandler(g_OnOutputTextMessage);
        }
        public Startup(bool nooutput)
        {
            g = new GBC();
            if (nooutput)
                g.OnOutputTextMessage += new MySilmoon.OutputTextMessageHandler(g_OnOutputTextMessage);
        }

        void g_OnOutputTextMessage(string message, int flag)
        {
            lock (this)
            {

                if (flag == -1) Console.ForegroundColor = ConsoleColor.Red;
                if (flag == 1) Console.ForegroundColor = ConsoleColor.Green;
                if (flag == 2) Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine(message);
                Console.ResetColor();
            }
        }
        public void Start()
        {
            g.Start();
        }
        public void Stop()
        {
            g.Stop();
        }
    }
}
